#ifndef HSETTINGPANEL_H
#define HSETTINGPANEL_H

#include <QtWidgets>

class HSettingPanel : public QWidget
{
    Q_OBJECT
public:
    HSettingPanel(QWidget *parent = 0);
    ~HSettingPanel();

protected:
    void                    paintEvent(QPaintEvent *event);

private:
    void                    initControlSize();
    void                    initUI();
    void                    createComponent(QString strTitle,QString strData);

private slots:
    void                    sltLineEditFocusStateChanged(bool bHasFocus);
    void                    sltSave();
    void                    sltCloseBtnClicked();
private:
    QList<QVBoxLayout*>     m_lstvblComponents;
    QList<QLabel*>          m_lstlblComponents;
    QHash<QString,QLineEdit*> m_hashDataToLineEdit;
    QVBoxLayout             *m_pvblMain;
    QVBoxLayout             *m_pvblSubMain;
    QHBoxLayout             *m_phblPanelControl;
    QHBoxLayout             *m_phblFunctionBtns;

    QPushButton             *m_ppbMin;
    QPushButton             *m_ppbClose;
    QPushButton             *m_ppbSave;
    QPushButton             *m_ppbCancel;

    int                     m_nLayoutSpacing;

    int                     m_nMainLayoutL;
    int                     m_nMainLayoutU;
    int                     m_nMainLayoutR;
    int                     m_nMainLayoutB;

    int                     m_nSubMainLayoutL;
    int                     m_nSubMainLayoutU;
    int                     m_nSubMainLayoutR;
    int                     m_nSubMainLayoutB;

    QHash<QString,QString>  m_hashConfigNameToValue;

signals:
    void                    sigSaveBtnClicked();
    void                    sigCancelBtnClicked();
	void                    sigMinBtnClicked();
};

#endif
